/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mx.saco.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author jethro.gutierrez
 */
@Entity
@Table(name = "tt_elemento")
@NamedQueries({
    @NamedQuery(name = "Elemento.findAll", query = "SELECT e FROM Elemento e"),
    @NamedQuery(name = "Elemento.findByIdElemento", query = "SELECT e FROM Elemento e WHERE e.idElemento = :idElemento"),
    @NamedQuery(name = "Elemento.findByDescripcion", query = "SELECT e FROM Elemento e WHERE e.descripcion = :descripcion"),
    @NamedQuery(name = "Elemento.findByValueChr", query = "SELECT e FROM Elemento e WHERE e.valueChr = :valueChr"),
    @NamedQuery(name = "Elemento.findByValueInt", query = "SELECT e FROM Elemento e WHERE e.valueInt = :valueInt"),
    @NamedQuery(name = "Elemento.findByValueDoub", query = "SELECT e FROM Elemento e WHERE e.valueDoub = :valueDoub"),
    @NamedQuery(name = "Elemento.findByEstatus", query = "SELECT e FROM Elemento e WHERE e.estatus = :estatus")})
public class Elemento implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_elemento")
    private Long idElemento;
    @Column(name = "descripcion")
    private String descripcion;
    @Column(name = "value_chr")
    private String valueChr;
    @Column(name = "value_int")
    private Integer valueInt;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "value_doub")
    private Double valueDoub;
    @Basic(optional = false)
    @Column(name = "estatus")
    private String estatus;
    @ManyToMany(mappedBy = "elementoList")
    private List<Catalogo> catalogoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estatus")
    private List<Socio> socioList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estatus")
    private List<Actividad> actividadList;
    @OneToMany(mappedBy = "periodicidad")
    private List<Concepto> conceptoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "estatus")
    private List<Usuario> usuarioList;

    public Elemento() {
    }

    public Elemento(Long idElemento) {
        this.idElemento = idElemento;
    }

    public Elemento(Long idElemento, String estatus) {
        this.idElemento = idElemento;
        this.estatus = estatus;
    }

    public Long getIdElemento() {
        return idElemento;
    }

    public void setIdElemento(Long idElemento) {
        this.idElemento = idElemento;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getValueChr() {
        return valueChr;
    }

    public void setValueChr(String valueChr) {
        this.valueChr = valueChr;
    }

    public Integer getValueInt() {
        return valueInt;
    }

    public void setValueInt(Integer valueInt) {
        this.valueInt = valueInt;
    }

    public Double getValueDoub() {
        return valueDoub;
    }

    public void setValueDoub(Double valueDoub) {
        this.valueDoub = valueDoub;
    }

    public String getEstatus() {
        return estatus;
    }

    public void setEstatus(String estatus) {
        this.estatus = estatus;
    }

    public List<Catalogo> getCatalogoList() {
        return catalogoList;
    }

    public void setCatalogoList(List<Catalogo> catalogoList) {
        this.catalogoList = catalogoList;
    }

    public List<Socio> getSocioList() {
        return socioList;
    }

    public void setSocioList(List<Socio> socioList) {
        this.socioList = socioList;
    }

    public List<Actividad> getActividadList() {
        return actividadList;
    }

    public void setActividadList(List<Actividad> actividadList) {
        this.actividadList = actividadList;
    }

    public List<Concepto> getConceptoList() {
        return conceptoList;
    }

    public void setConceptoList(List<Concepto> conceptoList) {
        this.conceptoList = conceptoList;
    }

    public List<Usuario> getUsuarioList() {
        return usuarioList;
    }

    public void setUsuarioList(List<Usuario> usuarioList) {
        this.usuarioList = usuarioList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idElemento != null ? idElemento.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Elemento)) {
            return false;
        }
        Elemento other = (Elemento) object;
        if ((this.idElemento == null && other.idElemento != null) || (this.idElemento != null && !this.idElemento.equals(other.idElemento))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.mx.saco.entity.Elemento[ idElemento=" + idElemento + " ]";
    }
    
}
